package com.syh.jn.scm.infrastructure.repository.model.sale;

import com.syh.core.ddd.infrastructure.repository.model.SuperBusinessModel;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * 销售订单项
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "T_SALE_ORDER_ITEM")
@EqualsAndHashCode(callSuper = true)
public class SaleOrderItemModel extends SuperBusinessModel {
  /**
   * 商品id
   */
  @Column(name = "GOODS_ID", columnDefinition = "bigint COMMENT '商品id'")
  private Long goodsId;
  /**
   * 销售订单id
   */
  @Column(name = "SALE_ORDER_ID", columnDefinition = "bigint COMMENT '销售订单id'")
  private Long saleOrderId;
  /**
   * 商品名称
   */
  @Column(name = "GOODS_NAME", columnDefinition = "varchar(100) COMMENT '商品名称'")
  private String goodsName;
  /**
   * 分类id
   */
  @Column(name = "CATEGORY_ID", columnDefinition = "bigint COMMENT '分类id'")
  private Long categoryId;
  /**
   * 品牌id
   */
  @Column(name = "GOODS_BRAND_ID", columnDefinition = "bigint COMMENT '品牌id'")
  private Long goodsBrandId;
  /**
   * 品牌名称
   */
  @Column(name = "GOODS_BRAND_NAME", columnDefinition = "varchar(50) COMMENT '品牌名称'")
  private String goodsBrandName;
  /**
   * 商品编码
   */
  @Column(name = "GOODS_CODE", columnDefinition = "varchar(50) COMMENT '商品编码'")
  private String goodsCode;
  /**
   * 所属种类,应用分类编码
   */
  @Column(name = "CATEGORY_CODE", columnDefinition = "varchar(50) COMMENT '所属种类,应用分类编码'")
  private String categoryCode;
  /**
   * 所属种类名称
   */
  @Column(name = "CATEGORY_NAME", columnDefinition = "varchar(50) COMMENT '所属种类名称'")
  private String categoryName;
  /**
   * 计量单位
   */
  @Column(name = "UNITS", columnDefinition = "varchar(50) COMMENT '计量单位'")
  private String units;
  /**
   * 条码
   */
  @Column(name = "CODE_BAR", columnDefinition = "varchar(50) COMMENT '条码'")
  private String codeBar;
  /**
   * 单价
   */
  @Column(name = "PRICE", columnDefinition = "decimal(19,6) COMMENT '单价'")
  private BigDecimal price;
  /**
   * 商品数量（下游采购数量）
   */
  @Column(name = "QUANTITY", columnDefinition = "decimal(19,2) COMMENT '商品数量'")
  private BigDecimal quantity;
  /**
   * 已出库数量(发货)
   */
  @Column(name = "OUTED_QUANTITY", columnDefinition = "decimal(19,2) COMMENT '已出库数量'")
  private BigDecimal outedQuantity;
  /**
   * 商品总额
   */
  @Column(name = "TOTAL_AMOUNT", columnDefinition = "decimal(19,2) COMMENT '商品总额'")
  private BigDecimal totalAmount;
  /**
   * 物流单生成数量
   */
  @Column(name = "GENERATED_QUANTITY", columnDefinition = "decimal(19,2) COMMENT '物流单生成数量'")
  private BigDecimal generatedQuantity;
  /**
   * 销售退货生成数量
   */
  @Column(name = "GENERATED_RETURN_QUANTITY", columnDefinition = "decimal(19,2) COMMENT '销售退货生成数量'")
  private BigDecimal generatedReturnQuantity;
  /**
   * 出库数量(发货)
   */
  @Column(name = "OUT_QUANTITY", columnDefinition = "decimal(19,2) COMMENT '出库数量'")
  private BigDecimal outQuantity;
  /**
   * 下游收货数量
   */
  @Column(name = "IN_QUANTITY", columnDefinition = "decimal(19,2) COMMENT '下游收货数量'")
  private BigDecimal inQuantity;
  /**
   * 商品出库总额
   */
  @Column(name = "OUT_TOTAL_AMOUNT", columnDefinition = "decimal(19,2) COMMENT '商品出库总额'")
  private BigDecimal outTotalAmount;
  /**
   * 下游商品项收货总额
   */
  @Column(name = "IN_TOTAL_AMOUNT", columnDefinition = "decimal(19,2) COMMENT '下游商品项收货总额'")
  private BigDecimal inTotalAmount;
  /**
   * 备注
   */
  @Column(name = "REMARK", columnDefinition = "varchar(100) COMMENT '备注'")
  private String remark;
  /**
   * 商品实际毛重
   */
  @Column(name = "GROSS_WEIGHT", columnDefinition = "decimal(19,2) COMMENT '商品实际毛重'")
  private BigDecimal grossWeight;
  /**
   * 商品实际净重
   */
  @Column(name = "NET_WEIGHT", columnDefinition = "decimal(19,2) COMMENT '商品实际净重'")
  private BigDecimal netWeight;
  /**
   * 所属种类,应用分类的父类目录
   */
  @Column(name = "CATEGORY_CATALOG_CODE", columnDefinition = "varchar(50) COMMENT '所属种类,应用分类的父类目录'", length = 50)
  private String categoryCatalogCode;
  /**
   * -1 辅助商品  1  基础商品
   */
  @Column(name = "IS_DEFAULT_GOODS", columnDefinition = "smallint COMMENT '-1 辅助商品  1  基础商品'")
  private Short isDefaultGoods;
  /**
   * 与基础商品转换率（如果是基础商品 则等于1）
   */
  @Column(name = "CONVERSION_RATE", columnDefinition = "decimal(19,2) COMMENT '与基础商品转换率（如果是基础商品 则等于1）'")
  private BigDecimal conversionRate;
  /**
   * 规格
   */
  @Column(name = "SPEC_NAME", columnDefinition = "varchar(50) COMMENT '规格'")
  private String specName;
}
